<template>
	<view class="card">
		<!-- 标题 -->
		<view v-if="showhead" class="p-2 main-border-color" :class="getHeadClass">
			<slot name="title">
				<text :class="headTitleWeight?'font-weight':''" class="font-md ">{{headTitle}}</text>
			</slot>
		</view>
		<view :class="getBodyClass">
			<image lazy-load v-if="bodyCover" :src="bodyCover" mode="widthFix"></image>
			<slot />
		</view>
		
	</view>
</template>

<script>
	export default{
		props:{
			headTitle:String,
			bodyCover:String,
			showhead:{
				type:Boolean,
				default:true
			},
			headBorderBottom:{
				type:Boolean,
				default:true
			},
			headTitleWeight:{
				type:Boolean,
				default:true
			},
			bodyPadding:{
				type:Boolean,
				default:false
			}
		},
		computed:{
			getHeadClass(){
				return `${this.headBorderBottom?'border-bottom':''}`
			},
			getBodyClass(){
				return `${this.bodyPadding?'p-2':''}`
			}
		}
	}
</script>

<style>
</style>
